<%--
  Created by IntelliJ IDEA.
  User: LH
  Date: 2021-12-6 0006
  Time: 09:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>

<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset='utf-8'>
    <meta name="author" content="order by dede58.com"/>
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="stylesheet" type="text/css" href="css/page.css"/>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/common.css" />
    <script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.js"></script>
    <script src="js/common.js"></script>
    <script>
        $(function () {

            $('#lose').click(function () {
                let count=$('#buyCount').val();
                if(count>1){
                    $('#buyCount').val(count-1);
                    $('#max').html("");
                }

            });
            $('#add').click(function () {
                //通过goodsId查询库存数
                var gid=$('#goodsid').val();
                let count=$('#buyCount').val();
                $.post("goods",{"method":"queryCount","gid":gid},function (data) {
                    var maxpage = parseInt(data);

                    if(count<maxpage){
                        var number = parseInt(count);
                        $('#buyCount').val(number+1);
                    }else {
                        $('#max').html("库存告急！");
                    }
                })



            });

        });
        function buy() {
           var gid=$('#goodsid').val();
           var count=$('#buyCount').val();
           // location.href="goods?method=buyOneGoods&goodsId="+gid+"&buyCount="+count+"";
            $.post("goods",{"method":"buyOneGoods","goodsId":gid,"count":count});
        }
        //加入购物车
        function collect() {
            var gid=$('#goodsid').val();
            var count=$('#buyCount').val();
            $.post("goods",{"method":"collect","goodsId":gid,"count":count},function (data) {
                if(data=='yes'){
                    alert("添加购物车成功！");
                }else {
                    alert("购物车已有该商品！");
                }
            })
        }
    </script>
</head>
<body>
<!--header star-->
<div class="header clearfix">
    <div class="top clearfix">
        <div class="topctent clearfix">
            <div class="left clearfix fl">
                <c:if test="${sessionScope.userName==null}">

                </c:if>
                <c:if test="${sessionScope.userName!=null}">
                    公告：您好，尊敬的<span style="color: black;font-weight:bold ">&nbsp;${sessionScope.userName}&nbsp;</span>欢迎登录千硕拍卖场
                </c:if>
            </div>
            <div class="right clearfix fr">
                <c:if test="${sessionScope.userName==null}">
                    <div class="zuo clearfix fl">
                        <ul class="clearfix fl">
                            <li>
                                <span class="fl">您好，请</span>
                                <a href="sign.jsp" class="fl">&nbsp;登录</a>
                            </li>
                            <li>
                                <a href="register.jsp" >
                                    免费注册
                                </a>
                            </li>
                        </ul>
                    </div>
                </c:if>
                <c:if test="${sessionScope.userName!=null}">
                    <ul class="clearfix fl" style="display: inline-block">
                        <li>
                            <a href="grxx.jsp" class="fl" style="text-align: center;line-height: 100%">${sessionScope.userName}</a>
                            <span style="width: 20px">---</span>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            <a href="logout.jsp" class="fl" style="text-align: center;line-height: 100%">退出登录</a>
                        </li>

                    </ul>
                </c:if>

                <div class="shopcar-btn clearfix fl">
                    <a href="shopping.jsp"  class="box-s">
                        购物车（0）
                    </a>
                </div>
                <div class="fenxiang clearfix fl">
                    <span class="fl">分享到：</span>
                    <ul class="clearfix fl">
                        <li><a href="#"><img src="img/sina.png" /></a></li>
                        <li><a href="#"><img src="img/qq.png" /></a></li>
                        <li><a href="#"><img src="img/wechat.png" /></a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom clearfix">
        <div class="logo clearfix">
            <a href="index.jsp"></a>
        </div>
        <div class="search clearfix fr ra5">
            <input type="text" class="fl" name="" id="r" value="" placeholder="请输入您要搜索的内容" />
            <input type="button" name="" id="e" value="搜索" class="fl box-s" />
        </div>
    </div>
</div>
<!--header end-->

<!--navbar star-->
<div class="navbar clearfix">
    <div class="content clearfix">
        <ul>
            <li class="cur">
                <a href="init?method=mainInit">首页</a>
            </li>
            <li>
                <a href="special.jsp">专场</a>
            </li>
            <li>
                <a href="mall.jsp">商城</a>
            </li>
        </ul>
    </div>
</div>
<!--navbar end-->
<!--Main-wrap-->
<div class="main-wrap graybgtwo pt40 pb40">
    <div class="wrapper">
        <!--Main-pro-info-->
        <div class="main-pro-info white-box  clearfix">
            <div class="fangda clearfix fl">
                <div id="showbox">
                    <img src="${goods.goodsPic}" width="1000" height="1000" />
                </div><!--展示图片盒子-->
                <div id="showsum"></div><!--展示图片里边-->

            </div>
            <!--产品信息介绍-->
            <div class="fr pro-intro">
                <div class="pb20 line-bot">
                    <h3 class="fs26 darkblack lh50 ellipsis">墙角数枝梅，凌寒独自开</h3>
                    <p class="fs14 lh20 over2">${goods.goodsRep}</p>
                    <p class="price pt10 clearfix"><strong class="fl red fs40">¥${goods.goodsNewPrice}</strong><em class="fl white ml20 lh20 mt20">已售：2000件</em></p>
                </div>
                <div class="pro-ctent clearfix">
                    <ul>
                        <li><span>艺 术 家 ：</span>${goods.goodsAuthor}</li>
                        <li><span>尺      寸 ：</span>${goods.goodsSize}×${goodsSize}cm</li>
                        <li><span>价      格 ：</span>${goods.goodsNewPrice}</li>
                        <li><span>年      份 ：</span>${goods.goodsTime}</li>
                    </ul>
                </div>
                <div class="pt10">
                    <div class="p-count fs14 mt20 clearfix">
                        <label class="fl lh40 darkblack">数量：</label>
                        <p class="fl count ml10 clearfix">
                            <a href="javascript:" class="fl fs30 reduction" id="lose">-</a>
                            <input type="text" value=1 class="fl fs16" id="buyCount">
                            <input type="hidden" value="${requestScope.goods.goodsId}" id="goodsid">
                            <a href="javascript:" class="fl fs30 add" id="add">+</a>
                        </p>
                        <span style="color: red" id="max"></span>
                    </div>
                    <div class="but-box mt30">
                        <c:if test="${sessionScope.userName!=null}">
                            <input type="button" class="fl orange-but radius3" onclick="buy()" value="立即购买">
                            <input type="button" class="fl ml20 orange-but gray-but radius3" onclick="collect()" value="加入购物车">
                        </c:if>
                        <c:if test="${sessionScope.userName==null}">
                            <input type="button" class="fl orange-but radius3" onclick="window.location.href='sign.jsp'" value="立即购买">
                            <input type="button" class="fl ml20 orange-but gray-but radius3" onclick="window.location.href='sign.jsp'" value="加入购物车">
                        </c:if>

                    </div>
                </div>
            </div>
            <!--/end-->
        </div>
</div>
<!--/end-->
<!--footer star-->
<div class="footer clearfix">
    <div class="content clearfix">
        <div class="top clearfix">
            <div class="list clearfix fl box-s">
                <div class="part icon1 box-s">
                    <h3>专业</h3>
                    <p>拥有资深艺术顾问和先进交易平台，安全物流，快捷支付。</p>
                </div>
            </div>
            <div class="list clearfix fl box-s">
                <div class="part icon2 box-s">
                    <h3>保真</h3>
                    <p>阵容强大的艺术评鉴团，确保平台上的藏品货真价实。</p>
                </div>
            </div>
            <div class="list clearfix fl box-s">
                <div class="part icon3 box-s">
                    <h3>保值</h3>
                    <p>为您精选具备艺术价值的作品，助您的资产保值、增值。</p>
                </div>
            </div>
        </div>
        <div class="bottom clearfix">
            <div class="left clearfix fl">
                <div class="list clearfix">
                    <div class="shang clearfix">
                        <p>新手指南</p>
                        <span></span>
                    </div>
                    <div class="xia clearfix">
                        <ul>
                            <li><a href="scgmlc.html">商城购买流程</a></li>
                            <li><a href="cjwt.html">常见问题</a></li>
                        </ul>
                    </div>
                </div>
                <div class="list clearfix">
                    <div class="shang clearfix">
                        <p>账户管理</p>
                        <span></span>
                    </div>
                    <div class="xia clearfix">
                        <ul>
                            <li><a href="">账户充值</a></li>
                            <li><a href="">账户提现</a></li>
                            <li><a href="zffs.html">支付方式</a></li>
                        </ul>
                    </div>
                </div>
                <div class="list clearfix">
                    <div class="shang clearfix">
                        <p>服务合作</p>
                        <span></span>
                    </div>
                    <div class="xia clearfix">
                        <ul>
                            <li><a href="">友情链接</a></li>
                            <li><a href="">艺术家入驻</a></li>
                        </ul>
                    </div>
                </div>
                <div class="list clearfix">
                    <div class="shang clearfix">
                        <p>关于我们</p>
                        <span></span>
                    </div>
                    <div class="xia clearfix">
                        <ul>
                            <li><a href="">公司简介</a></li>
                            <li><a href="">联系我们</a></li>
                            <li><a href="">加入我们</a></li>
                        </ul>
                    </div>
                </div>
                <div class="list clearfix">
                    <div class="shang clearfix">
                        <p>售后服务</p>
                        <span></span>
                    </div>
                    <div class="xia clearfix">
                        <ul>
                            <li><a href="">物流说明</a></li>
                            <li><a href="">免责声明</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="middle clearfix fl">
                <ul>
                    <li><img src="img/ewm.jpg"/></li>
                    <li><img src="img/ewm.jpg"/></li>
                </ul>
            </div>
            <div class="right clearfix fr">
                <p class="bt">免费咨询热线：</p>
                <p class="tel">400-000-0000</p>
                <p class="fu-bt">(周一到周五8:00-22:00)</p>
            </div>
        </div>
    </div>
    <div class="banquan clearfix ta-center">
        Copyright © 2020 檀卡文化(tankawenhua). All Rights Reserved.
    </div>
</div>
</div>
</body>
<script src="js/other.js" tppabs="http://demo.mxyhn.xyz:8020/cssthemes6/1.27ZF11/js/other.js" type="text/javascript" ></script>
</html>

